# Blacklist by default since nvidia* modules have the same aliases
blacklist nvidia340

# Fail if nouveau loaded
install nvidia340 if /bin/grep -qw "^nouveau" /proc/modules; then /bin/false; else /sbin/modprobe -i nvidia340 $CMDLINE_OPTS; fi

# Load the right module when requested with the name "nvidia"
install nvidia M=$(/bin/readlink /etc/alternatives/libGL | /usr/bin/cut -d/ -f4 | /bin/grep nvidia) && /sbin/modprobe $M $CMDLINE_OPTS
